package com.wr.auth.common.constants;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author MyPC
 */
@Data
@Component
@ConfigurationProperties("config.wx")
public class WeChatConstants {

    private String letAppId;

    private String letAppSecret;

    private String webAppId;

    private String webAppSecret;

    private String webRedirectUrl;

    private String gzAppId;

    private String gzAppSecret;

    private String gzRedirectUrl;

    /**
     * 微信官方获取微信用户唯一标识的openID的接口
     */
    private final String wxLetUrl = "https://api.weixin.qq.com/sns/jscode2session";

    /**
     * web网站登录
     */
    private final String wxPublicUrl = "https://open.weixin.qq.com/connect/qrconnect";

    /**
     * 公众号网页授权
     */
    private final String wxGzAuthUrl = "https://open.weixin.qq.com/connect/oauth2/authorize";

    /**
     * 获取access_token
     */
    private final String wzAuthUrl = "https://api.weixin.qq.com/sns/oauth2/access_token";

    /**
     * 判断access_token是否有效
     */
    private final String wxIsTokenUrl = "https://api.weixin.qq.com/sns/auth?access_token=ACCESS_TOKEN&openid=OPENID";

    /**
     * 刷新access_token
     */
    private final String wxRefreshTokenUrl = "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=APPID&grant_type=refresh_token&refresh_token=REFRESH_TOKEN";

    /**
     * 获取登录用户信息
     */
    private final String wxInfoUrl = "https://api.weixin.qq.com/sns/userinfo";
}
